SELECT
convert(varchar(30),@@servername) as Servername,
convert(varchar(30),SERVERPROPERTY('Collation')) as Collation,
convert(varchar(20),SERVERPROPERTY('ComputerNamePhysicalNetBIOS')) as ComputerNamePhysicalNetBIOS,
convert(varchar(30),SERVERPROPERTY('Edition')) as Edition,
convert(varchar(30),SERVERPROPERTY('InstanceName')) as InstanceName

SELECT
convert(varchar(10),SERVERPROPERTY('IsClustered')) as IsClustered,
convert(varchar(10),SERVERPROPERTY('IsFullTextInstalled')) as IsFullTextInstalled,
convert(varchar(10),SERVERPROPERTY('IsSingleUser')) as IsSingleUser,
convert(varchar(25),SERVERPROPERTY('MachineName')) as MachineName,
convert(varchar(20),SERVERPROPERTY('ProductVersion')) as ProductVersion,
convert(varchar(20),SERVERPROPERTY('ProductLevel')) as ProductLevel,
convert(varchar(30),SERVERPROPERTY('ServerName')) as ServerName

SELECT
convert(varchar(15),SERVERPROPERTY('BuildClrVersion')) as dotNET_CLR_Version,
convert(varchar(10),SERVERPROPERTY('ProcessID')) as ProcessID,
convert(varchar(10),SERVERPROPERTY('IsIntegratedSecurityOnly')) as IsIntegratedSecurityOnly,
convert(varchar(20),SERVERPROPERTY('ResourceLastUpdateDateTime')) as ResourceLastUpdateDateTime,
convert(varchar(20),SERVERPROPERTY('ResourceVersion')) as ResourceVersion,
convert(varchar(15),SERVERPROPERTY('LicenseType')) as LicenseType,
convert(varchar(10),SERVERPROPERTY('NumLicenses')) as NumLicenses

SELECT
convert(varchar(15),SERVERPROPERTY('CollationID')) as CollationID,
convert(varchar(20),SERVERPROPERTY('ComparisonStyle')) as ComparisonStyle,
convert(varchar(15),SERVERPROPERTY('EditionID')) as EditionID,
convert(varchar(10),SERVERPROPERTY('EngineEdition')) as EngineEdition,
convert(varchar(10),SERVERPROPERTY('LCID')) as LCID,
convert(varchar(10),SERVERPROPERTY('SqlCharSet')) as SqlCharSet,
convert(varchar(10),SERVERPROPERTY('SqlCharSetName')) as SqlCharSetName,
convert(varchar(10),SERVERPROPERTY('SqlSortOrder')) as SqlSortOrder,
convert(varchar(20),SERVERPROPERTY('SqlSortOrderName')) as SqlSortOrderName,
convert(varchar(20),SERVERPROPERTY('FilestreamShareName')) as FilestreamShareName,
convert(varchar(10),SERVERPROPERTY('FilestreamConfiguredLevel')) as FilestreamConfiguredLevel,
convert(varchar(10),SERVERPROPERTY('FilestreamEffectiveLevel')) as FilestreamEffectiveLevel

Create Table #GetInstances
( Value nvarchar(100),
 InstanceNames nvarchar(100),
 Data nvarchar(100))

Insert into #GetInstances
EXECUTE xp_regread
  @rootkey = 'HKEY_LOCAL_MACHINE',
  @key = 'SOFTWARE\Microsoft\Microsoft SQL Server',
  @value_name = 'InstalledInstances'
 
select InstanceNames from #GetInstances
drop table #GetInstances

Create Table #GetInstances32
( Value nvarchar(100),
 InstanceNames_WoW nvarchar(100),
 Data nvarchar(100))

Insert into #GetInstances32
EXECUTE xp_regread
  @rootkey = 'HKEY_LOCAL_MACHINE',
  @key = 'SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server',
  @value_name = 'InstalledInstances'
 
select InstanceNames_WoW from #GetInstances32
drop table #GetInstances32

----------------------------
SELECT * FROM fn_virtualservernodes() 
------------------------
--SELECT * FROM fn_ servershareddrives() 


SELECT SERVERPROPERTY('errorlogfilename') AS Errorlog 
go
select 'SQL ErrorLog 1' 
go
xp_readerrorlog 1 
go
select 'SQL ErrorLog 2' 
go
xp_readerrorlog 2
go
select 'SQL ErrorLog 3' 
go
xp_readerrorlog 3 
go
select 'SQL Agent ErrorLog 1' 
go
xp_readerrorlog 1,2
go
select 'SQL Agent ErrorLog 2' 
go
xp_readerrorlog 2,2
go
select 'SQL Agent ErrorLog 3' 
go
xp_readerrorlog 3,2
go

select * from sys.master_files
